FUZZER_NAME := 'fuzzer_no_std'
PROJECT_DIR := absolute_path(".")
PROFILE := 'release'
PROFILE_DIR := if PROFILE == "release" { "release" } else if PROFILE == "dev" { "debug" } else { "debug" }
CARGO_TARGET_DIR := env("CARGO_TARGET_DIR", "target")
FUZZER := CARGO_TARGET_DIR / PROFILE_DIR / FUZZER_NAME
LIBAFL_CC := CARGO_TARGET_DIR / PROFILE_DIR / "libafl_cc"

build:
    cargo build --profile={{PROFILE}} -Zbuild-std=core,alloc --target x86_64-unknown-linux-gnu

build_aarch:
	cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-none -v --profile {{PROFILE}}

[linux]
test: build
	cargo run -Zbuild-std=core,alloc --target x86_64-unknown-linux-gnu || true

[macos]
[windows]
test: build
	echo "Unsupported on this platform"


clean:
	cargo clean
